package cn.ctbu.xiaopeng.studentscoremanage.api;

import cn.ctbu.xiaopeng.studentscoremanage.pojo.vo.ClassesListVO;
import cn.ctbu.xiaopeng.studentscoremanage.pojo.vo.Result;
import cn.ctbu.xiaopeng.studentscoremanage.service.ClassesService;
import cn.ctbu.xiaopeng.studentscoremanage.utils.ResultUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author xiaopeng
 * @version 1.0
 */
@RestController
@RequestMapping("/api/classes")
@RequiredArgsConstructor
public class ClassesApiController {

    private final ClassesService classesService;

    /**
     * 获取所有班级信息
     *
     * @return
     */
    @GetMapping("/getAll")
    public Result<List<ClassesListVO>> getAll() {
        return ResultUtils.success(classesService.getAll());
    }
}
